class Question
  attr_reader :id, :text, :answers

  def initialize(id, text, &block)
    @id = id
    @text = text
    @answers = []
    instance_eval(&block)
  end

  def answer(text, &block)
    a = Answer.new(self, text)
    a.instance_eval(&block)
    @answers << a
  end
end
